#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
using PIC = pair<int, char>;

const int N = 3e5 + 10;

int n;
string s;
bool st[N][27];
vector<PIC> str;
int q[N];
bool res[N];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int tt = -1;

    cin >> s;
    n = s.length();

    for(int i = 0; i < n; i ++){
        if(s[i] == '('){
            q[++tt] = i;
        }else if(s[i] == ')'){
            int p = q[tt];
            tt--;

            int l = 0, r = str.size() - 1;
            while(l < r){
                int mid = l + r >> 1;
                if(str[mid].first <= p){
                    l = mid + 1;
                }else{
                    r = mid;
                }
            }

            if(str.empty()) continue;
            if(str[l].first <= p) continue;

            int cnt = str.size() - l;
            for(int j = 1; j <= cnt; j ++){
                st[i][str[str.size() - 1].second - 'a'] = true;
                str.pop_back();
            }

            
        }else{
            str.push_back({i, s[i]});
        }
    }

    for(int i = 0; i < n; i ++){
        if(s[i] == '('){
            continue;
        }else if(s[i] == ')'){
            for(int j = 0; j < 26; j ++){
                if(st[i][j]) res[j] = false;
            }
        }else{
            if(res[s[i] - 'a']){
    
                cout << "No" << '\n';
                return 0;
            }

            res[s[i] - 'a'] = true;
        }
    }

    cout << "Yes" << '\n';

    return 0;
}